package com.javautil;

import java.util.Calendar;
import java.util.Date;

public class CalendDemo {
    public static void main(String[] args) {
        Calendar calendar0308 = Calendar.getInstance();
        calendar0308.set(2022, 2, 8, 0, 0, 0);
        Calendar calendar0309 = Calendar.getInstance();
        Date date = new Date(1646755200000L);
        calendar0309.setTime(date);
        Calendar calendar = Calendar.getInstance();
        calendar.set(2022, 2, 8, 2, 15, 13);
        if (calendar.before(calendar0308) || calendar.after(calendar0309)) {
            System.out.println("时间不合法");
        } else {
            System.out.println("时间合法");
        }
    }
}
